package com.eii.common.web.page;

import com.eii.common.utils.ServletUtils;
import com.eii.common.utils.StrConvert;

/**
 * 表格数据处理
 *
 */
public class PageSupport
{
    /**
     * 当前记录起始索引
     */
    public static final String PAGE_NUM = "pageNum";

    /**
     * 每页显示记录数
     */
    public static final String PAGE_SIZE = "pageSize";

    /**
     * 封装分页对象
     */
    public static PageParam getPageParam()
    {
        PageParam pageParam = new PageParam();
        pageParam.setPageNum(StrConvert.toInt(ServletUtils.getParameter(PAGE_NUM), 1));
        pageParam.setPageSize(StrConvert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10));
        return pageParam;
    }

    public static PageParam buildPageRequest()
    {
        return getPageParam();
    }
}
